#include <stdio.h>
#include <stdlib.h>

typedef struct linknode 
{
	int data;
	struct linknode *next;
}mynode;


mynode *creat();
int headinsert(mynode *H,int inputnum);
void view(mynode *H);

int main(int argc, const char *argv[])
{
	mynode *H=creat();
	int inputnum;
	for(int i=0;i<5;i++)
	{
		printf("plz input num(%d)\n",i+1);
		scanf("%d",&inputnum);
		headinsert(H,inputnum);
	}
	view(H);
	return 0;
}


mynode *creat()
{
	mynode *H=(mynode *)malloc(sizeof(mynode));
	H->data=0;
	H->next=NULL;

	return H;
}

int headinsert(mynode *H,int inputnum)
{
	mynode *p=(mynode *)malloc(sizeof(mynode));
	p->data=inputnum;
	p->next=H->next;
	H->next=p;

	return 0;
}

void view(mynode *H)
{
	while(H->next!=NULL)
	{
		H=H->next;
		printf("%d ",H->data);
	}
	
}
